import com.sun.org.apache.regexp.internal.RE;

import java.util.Scanner;

/**
 * @Author @fiber-cloud
 * @Date 2025/8/3 16:37
 * 类与结构体
 */
public class Struct_and_class {

      public class Point1 {
        int x;
        int y;
        public Point1(int x, int y) {
          this.x = x;
          this.y = y;
        }
      }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        //学生姓名
        String bestName = "";
        int bestC1 = -1;
        int bestC2 = -1;
        int bestC3 = -1;
        int bestSum = -1;

        for (int i = 0; i < n; i++) {
            String name = scanner.next();
            int c1 = scanner.nextInt();
            int c2 = scanner.nextInt();
            int c3 = scanner.nextInt();

            int sum = c1 + c2 + c3;

            if (sum > bestSum){
                bestSum = sum;
                bestName = name;
                bestC1 = c1;
                bestC2 = c2;
                bestC3 = c3;
            }
        }
        System.out.println(bestName+" "+bestC1+" "+bestC2+" "+bestC3+" ");
    }
    /**
     * 代码中的类名、方法名、参数名已经指定，请勿修改，直接返回方法规定的值即可
     *
     * 计算A点与B点之间的距离
     * @param point_A Point类 A点
     * @param point_B Point类 B点
     * @return double浮点型
     */
    public double calculateDistance (Point1 point_A, Point1 point_B) {

        double x = point_A.x - point_B.x;
        double y = point_A.y - point_B.y;
        //Math.hypot() 函数返回它的所有参数的平方和的平方根
        return Math.hypot(x,y);
    }

    static class Student {
        int id;
        int academic_score;
        int activity_score;

        public Student(int id, int academic, int activity) {
            this.id = id;
            this.academic_score = academic;
            this.activity_score = activity;
        }
    }

    static boolean isExcellent(Student student) {
        // S=A×70%+B×30%
        double sum = student.academic_score*0.7 + student.activity_score*0.3;
        if ((student.activity_score + student.academic_score) > 140 && (sum >80 || sum == 80)){
            return true;
        }
        return false;
    }


    static class Point2 {
        double x, y;

        Point2(double a, double b) {
            x = a;
            y = b;
        }
    }

    static class Line {
        Point2 pointA, pointB;

        Line(Point2 a, Point2 b) {
            pointA = a;
            pointB = b;
        }
    }

    static double getDistance(Point2 P, Line L) {
        double xp = P.x , yp = P.y;
        double xA = L.pointA.x , yA = L.pointA.y;
        double xB = L.pointB.x , yB = L.pointB.y;

        double lineDist = Math.hypot(xA-xB,yA-yB);

        //如果直线的两点重合，则计算的其实是点到点的距离。
        if (lineDist == 0){
            return Math.hypot(xp - xA,yp - yA);
        }

        double A = yA - yB;
        double B = xB - xA;
        double C = xA*yB - xB*yA;

        double num = Math.abs(A*xp + B*yp + C);
        return num/lineDist;
    }



    static class Point3 {
        double x, y;

        Point3(double a, double b) {
            x = a;
            y = b;
        }
    }

    static class Triangle {
        Point3 a, b, c;

        Triangle(Point3 a, Point3 b, Point3 c) {
            this.a = a;
            this.b = b;
            this.c = c;
        }
    }

    static double getArea(Triangle T) {
        Point3 pA = T.a;
        Point3 pB = T.b;
        Point3 pC = T.c;

        double crossProduct = (pB.x - pA.x) * (pC.y - pA.y) - (pC.x - pA.x) * (pB.y - pA.y);

        return Math.abs(crossProduct) / 2.0;
    }




}
